﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Atendex.Dominio;

namespace Atendex.Dominio.ActiveRecord
{
    [ActiveRecord("area_negocio")]
    [Serializable]
    public class AreaNegocioAR : ActiveRecordBase<AreaNegocioAR>, IAreaNegocio
    {
        private AreaNegocioAR()     { }
        internal AreaNegocioAR(string nome, string email)
        {
            this.Nome = nome;
            this.Email = email;
        }
        private int _id;
        [PrimaryKey]
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }
        private string _descricao;
        [Property]
        public string Descricao
        {
            get { return _descricao; }
            set { _descricao = value; }
        }
        private string _email;
        [Property]
        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }
        private string _responsavel;
        [Property]
        public string Responsavel
        {
            get { return _responsavel; }
            set { _responsavel = value; }
        }
        private string _nome;
        [Property]
        public string Nome
        {
            get { return _nome; }
            set { _nome = value; }
        }

        [Property]
        public bool Ativa { get; set; }

        [HasMany(typeof(TipoSolicitacaoAR), Cascade=ManyRelationCascadeEnum.All, Inverse=true)]
        public IList<ITipoSolicitacao> Solicitacoes { get; set; }
        public override string ToString()
        {
            return Descricao;
        }

        #region IAreaNegocio Members


        #endregion
    }
}
